package com.example.baseactivity1212;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        /*3.造数据*/
        String  x="第一行,第二行,第三行" ;
        String []xs =x.split(","); // 用split方法切割成数组
        List<String> xl = Arrays.asList(""); //转变成一个数组

        MyAdapter myAdapter=new MyAdapter() ;

        /*1.实例化*/
        ListView lv=findViewById(R.id.lv);


    }
    /* 2.BaseAdapter   */
    class  MyAdapter extends BaseAdapter{
        @Override
        public int getCount() {
            return 0;
        }

        @Override
        public Object getItem(int position) {
            return null;
        }

        @Override
        public long getItemId(int position) {
            return 0;
        }

        @Override        //int 第几行   View 视图   ViewGroup
        public View getView(int position, View view, ViewGroup parent) {
            if (view ==null){
                //制作view

            }
            /*  把两个TextView取出来 进行实例化 */
            TextView title=view.findViewById(R.id.title);
            TextView date= view.findViewById(R.id.date);

//           String s=date.get(position);
            title.setText("s");
            date.setText("2020年-12月-12日");





            return view;

        }
    }

}
